SYS.load('3rdparty/jQuery/jquery.ui/themes/'+SYS.UITheme+'/ui.all.css');
SYS.Messenger.Dialog = function(options)
{
	$.extend(this,{
		id:SYS.Messenger.Dialog.count++,
		isShow:true,
		options:options
	});
	this.initDialog();
}

$.extend(SYS.Messenger.Dialog.prototype,{
	initDialog:function()
	{
		$('body').append('<div id="dialog'+this.id+'">'+this.content+'</div>');
		$('#dialog'+this.id).dialog(this.options);
	},
	show:function()
	{
		$('#dialog'+this.id).dialog( "open" ) 
		this.isShow = true;
	},
	hide:function()
	{
		$('#dialog'+this.id).dialog( "close" ) 
		this.isShow = false;
	},
	toogle:function()
	{
		if(this.isShow)
		{
			this.hide();
		}
		else
		{
			this.show();
		}
	}
});
SYS.Messenger.Dialog.count = 1;